package com.web44.springboot.service.impl;

import com.web44.springboot.bean.MyUser;
import com.web44.springboot.mapper.MyUserMapper02;
import com.web44.springboot.service.IMyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Title: MyUserService
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/3/4 11:06
 */
@Service
@Transactional
public class MyUserService implements IMyUserService {

    @Autowired
    private MyUserMapper02 myUserMapper02;
    @Override
    public void addBatchUser(List<MyUser> users) {

        for (int i = 0;i<users.size();i++) {
//            if(i == 2) {
//                System.out.println(1/0);
//            }
            MyUser user = users.get(i);
            myUserMapper02.addUser(user);
        }

    }
}
